package com.netty.chat;

import com.netty.chat.server.WebsocketServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@MapperScan("com.netty.chat.dao")
public class NettyWebSocketChatApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(NettyWebSocketChatApplication.class, args);
        WebsocketServer server = context.getBean("WebSocketServer", WebsocketServer.class);
        new Thread(server).start();
    }

}
